package com.jlwl.houseservice.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jlwl.houseservice.entity.SystemConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 系统配置Mapper接口
 */
@Mapper
public interface SystemConfigMapper extends BaseMapper<SystemConfig> {

    /**
     * 根据配置组获取配置列表
     * @param configGroup 配置组
     * @return 配置列表
     */
    @Select("SELECT * FROM system_configs WHERE config_group = #{configGroup}")
    List<SystemConfig> getConfigsByGroup(@Param("configGroup") String configGroup);

    /**
     * 根据配置组和配置键获取配置
     * @param configGroup 配置组
     * @param configKey 配置键
     * @return 配置
     */
    @Select("SELECT * FROM system_configs WHERE config_group = #{configGroup} AND config_key = #{configKey}")
    SystemConfig getConfigByGroupAndKey(@Param("configGroup") String configGroup, @Param("configKey") String configKey);
} 